<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- <style>
        html,
        body {
            height: 100%;
        }

        div {
            width: 100%;
            height: 50%;
            border: 1px solid #000;
            margin-bottom: 10px;
        }
    </style> -->
</head>

<body>
    <input type="text" id="myInp">
    <!-- <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div> -->
    <script>

        document.documentElement.onscroll = JieL(function () {
            if ($(document).scrollTop() >= document.documentElement.scrollHeight - document.documentElement.clientHeight) {
                nowPage++;
                loadNewsList();
            }
        }, t)

        function JieL(fn, t) {
            var timer = null; // 保存定时器
            if (timer) return; // 如果有定时器再触发函数就回去不继续执行下面的

            return function () {
                timer = setTimeout(function () {
                    fn()
                    timer = null;
                }, t);
            }
        }


    </script>
</body>

</html>